package com.dunshan.order.controller;

import com.dunshan.order.service.UmsAdminService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author .dunshan
 * @program: dunshan-pef
 * @description: 管理员表
 * @date 2021-11-17 13:39:02
 */
@Log4j2
@RestController
public class UmsAdminController {

    @Autowired
    UmsAdminService umsAdminService;

    @Autowired
    StringRedisTemplate masterRedisTemplate;

    /**
     * 查询管理员信息
     *
     * @return
     */
    @GetMapping("/getAdmin")
    public Object selectUserInfo() {
        HashMap<Object, Object> map = new HashMap<>();
        String five = masterRedisTemplate.opsForValue().get("7d");
        map.put("redis", five);
        map.put("data", umsAdminService.list(null));
        log.info("结果{} ", map);
        return map;
    }
}
